package renthouse.dao;

import renthouse.entry.House;
import org.junit.Test;

import java.util.List;

/*
 * @创建者：黄苟苟
 * @创建时间：2021/5/19   0:08
 * @Description描述
 **/public class HouseDaoTest {
    HouseDao houseDao = new HouseDao();
    House house=new House();
    @Test
    public void insert() {

        house.setMasterid(2);
        house.setAddress("dongyuan");
        house.setState("租赁");
        house.setStyle("复古");
        house.setRent(5000);

        boolean f = houseDao.insert(house);
        if (f) {
            System.out.println("插入成功");
        }
    }

    @Test
    public void deleteById() {

        boolean f=houseDao.deleteById(2);
        if (f){
            System.out.println("删除成功");
        }

    }

    @Test
    public void updateById() {
        house.setHouseid(4);
        house.setRent(6000);

    }

    @Test
    public void query() {
        HouseDao houseDao=new HouseDao();
        House house=new House();
        house.setAddress("西苑");
        List <House> list= houseDao.query(house);
        System.out.println(list);
    }


    @Test
    public void queryCount() {

    }

    @Test
    public void queryForPage() {
        List<House> list= houseDao.queryForPage(house,2,2);
        System.out.println(list);
    }

    @Test
    public void queryById() {
       house= houseDao.queryById(2);
        System.out.println(house);

    }
}